#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QMessageBox>
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    //1.正常写法
    //connect(ui->pushButton, &QPushButton::clicked, this, &MainWindow::btnSlots);

    //2.lambda函数
    connect(ui->pushButton, &QPushButton::clicked, [=]{
        QMessageBox::information(this, "title", "clicked lambda");
    });
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::btnSlots()
{
    QMessageBox::information(this, "title", "clicked");
}
